<?php
/**
 * Created by PhpStorm.
 * User: 狗剩先生
 * Date: 2018/12/27
 * Time: 1:21
 */

namespace app\admin\model;

use think\Model;

class Member extends Model
{
    protected $autoWriteTimestamp = true;

    #   修改器
//    public function setPsdAttr ($val)
//    {
//        return md5($val);
//    }
    #   获取器
    public function getSexAttr ($val)
    {
        switch ($val){
            case '1':
                return  '男';
                break;
            case '2':
                return '女';
                break;
            default :
                return '未知';
                break;
        }
    }

    public function getMember ()
    {
        $result =  $this->where('id','>',0)
                    ->order('id desc')
                    ->select();
        return $result;
    }
}